package com.cg.asm.example.controller;

import com.alibaba.fastjson.JSONObject;
import com.cg.asm.client.CommonUtil;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/plugins")
public class Plugins {
    /**
     * 测试Get方法
     * @return
     */
    @GetMapping("/getTest")
    public JSONObject getTest() {
        System.out.println("into getTest");
        return CommonUtil.successJson();
    }
    /**
     * 模拟转发
     * @return
     */
    @GetMapping("/redirectUrl")
    public ResponseEntity redirectUrl() {
        System.out.println("into redirectUrl");
        return new ResponseEntity(HttpStatus.FORBIDDEN);
    }
}
